import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listAssess(query) {
  return request({
    url: '/system/assess/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getAssess(id) {
  return request({
    url: '/system/assess/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addAssess(data) {
  return request({
    url: '/system/assess',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateAssess(data) {
  return request({
    url: '/system/assess',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delAssess(id) {
  return request({
    url: '/system/assess/' + id,
    method: 'delete'
  })
}

//查询结构


export function getDeptTree() {
  return request({
    url: '/system/dept/deptTree',
    method: 'get'
  })
}



// 改变状态
export function changeUpdateAssess(id, status) {
  return request({
    url: '/system/assess/updateAssess',
    method: 'post',
    data: {
      id: id,
      isOpen: status
    }
  })
}


//待办任务
export function getTodoPendingList() {
  return request({
    url: '/system/assess/pending/list',
    method: 'get'
  })
}
//已办列表

export function getCompleteList() {
  return request({
    url: '/system/assess/complete/list',
    method: 'get'
  })
}

export function getListTaskId(data) {
  return request({
    url: `/system/question/list`,
    method: 'get',
    params: data
  })
}




//获取任务




export function getTaskList(scaleIdList) {
  var str=JSON.parse(scaleIdList)
  console.log(str,'str')
  return request({
    url: `/system/table/query/list?scaleIdList=${str}`,
    method: 'get'
  })
}




//提交答案

export function postTaskCommit(data){

  return request({
    url: `/system/assess/taskCommit`,
    method: 'post',
    data
  })

}



